// js 写法
// export class PostUrl {
//     constructor(name, url, type) { return {name, url, type}}
// }
// export class PostModule {
//     constructor(moduleName, baseUrl, urls) { return {moduleName, baseUrl, urls}}
// }

// ts 写法
export class PostUrl {
    constructor(public name: string, public url: string, public type: any) {}
}
export class PostModule {
    constructor(public moduleName: string, public baseUrl: string, public urls: Array<PostUrl>) {}
}

// 设置公共路径
const basePath = '/aa'
console.log(basePath);

// ts 写法
const postModules: Array<PostModule> = [
    new PostModule('getDataList', basePath, [
        new PostUrl('getMyData', `/app/v1_0/user/channels`, 'get'),
        new PostUrl('postMyData', `${basePath}/path/post`, 'post')
    ]),
    
    new PostModule('getDataList1', '', [
        new PostUrl('getMyData', `${basePath}/path/login`, 'get'),
        new PostUrl('postMyData', `${basePath}/path/post`, 'post')
    ])
]

// const postModules = [
//     new PostModule('getDataList', '', [
//         new PostUrl('getMyData', `${basePath}/path/login`, 'get'),
//         new PostUrl('postMyData', `${basePath}/path/post`, 'post')
//     ]),
    
//     new PostModule('getDataList', '', [
//         new PostUrl('getMyData', `${basePath}/path/login`, 'get'),
//         new PostUrl('postMyData', `${basePath}/path/post`, 'post')
//     ])
// ]

export default postModules;